package com.atguigu.juc.completableFuture;

import java.util.concurrent.CompletableFuture;

/**
 * @author yfstart
 * @create 2022-06-23 9:44
 */
public class CompletableFutureAPIThenAccept {
  public static void main(String[] args) {
    CompletableFuture.supplyAsync(()->{
      return 1;
    }).thenApply(r -> {
      return r + 1;
    }).thenApply(r -> {
      return r + 2;
    }).thenAccept(r -> {
      System.out.println("r = " + r);
    });
  }
}
